package com.nhii.base.common.baseAdapter;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.List;

/**
 * author : Alex
 * e-mail : xys9786@outlook.com
 * date   : 2020/3/2511:14
 * desc   : 适配器
 * version: 1.0
 */
public class MyPagerAdapter extends FragmentPagerAdapter {

    private List<Fragment> mFragments;

    private String[] mTitlesArrays;

    public MyPagerAdapter(FragmentManager fm, List<Fragment> mFragment, String[] mTitlesArray) {
        super(fm);
        mFragments = mFragment;
        mTitlesArrays = mTitlesArray;
    }

    @Override
    public int getCount() {
        return mFragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTitlesArrays[position];
    }

    @Override
    public Fragment getItem(int position) {
        return mFragments.get(position);
    }


}


